import React, { memo } from 'react'

import { baseUrl } from 'services/config'

import './style.css'

export default memo(function HomeNews(props) {

  const { homeNews } = props

  console.log(homeNews)
  return (
    <div className="homeNews">
      <div className="homeNews-title">最新资讯</div>
      <div className="homeNews">
        {
          homeNews.map((item, index) => {
            return (
              <div className="homeNews-item" key={item.id}>
                <div className="homeNews-left">
                  <img src={`${baseUrl}${item.imgSrc}` } alt="" />
                </div>
                <div className="homeNews-right">
                  <h3>{item.title}</h3>
                  <div className="homeNews-bottom">
                    <span>{item.from}</span>
                    <span>{item.date}</span>
                  </div>
                </div>
              </div>
            )
          })
        }
      </div>
    </div>
  )
})
